package com.pagepub.core.tag.validate;
 
import java.io.Serializable;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.commons.validator.Field;
import org.apache.commons.validator.util.ValidatorUtils;

import com.pagepub.core.exception.ExceptionMessageParam;
import com.pagepub.core.exception.SysException;
import com.pagepub.core.utils.CalendarUtil;
import com.pagepub.core.utils.SystemUtil;


/**
 * 实现web请求验证
 * @author ggd
 *
 */
public class HtmlValidate13Impl implements HtmlValidate,Serializable
{

	private static Log log = LogFactory.getLog(HtmlValidate13Impl.class);
	/**
	 * 使用validator1.3版本
	 */
	private static final long serialVersionUID = 1L;

	/**
	 * 校验值是否为空,是返回false否则true
	 * 
	 * @param bean
	 * @param field
	 * 
	 * @return
	 */

	public boolean validateEmpty(Object bean,Field field)
	{
		String value=null;
		if(field.getProperty()!=null&&field.getProperty().length()>0)
		{
			value=ValidatorUtils.getValueAsString(bean,field.getProperty());
		}
		try
		{
			if(value==null)
			{
				return true;
			}
			return !PortalValidate.isEmpty(value);
		}
		finally
		{
			value=null;
		}
	}
	/**
	 * 校验日期对象值是否为空,是返回false否则true
	 * @param bean
	 * @param field
	 * @return
	 */
	public boolean validateDateEmpty(Object bean,Field field)
	{
		String value=null;
		if(field.getProperty()!=null&&field.getProperty().length()>0)
		{
			value=ValidatorUtils.getValueAsString(bean,field.getProperty());
		}
		try
		{
			if(value==null)
			{
				return false;
			}
			return true;
		}
		finally
		{
			value=null;
		}
	}
	/**
	 * 校验email格式有效，有效返回false否则返回true
	 * 
	 * @param bean
	 * @param field
	 * 
	 * @return
	 */
	public boolean validateMail(Object bean,Field field)
	{
		String value=null;

		if(field.getProperty()!=null&&field.getProperty().length()>0)
		{
			value=ValidatorUtils.getValueAsString(bean,field.getProperty());
		}
		try
		{
			if(value==null||value.length()==0)
			{
				return true;
			}
			return PortalValidate.isEmail(value);
		}
		finally
		{
			value=null;
		}
	}

	/**
	 * 校验电话格式是否有效，有效返回false否则返回true
	 * 
	 * @param bean
	 * @param field
	 * 
	 * @return
	 */
	public boolean validatePhone(Object bean,Field field)
	{
		String value=null;

		if(field.getProperty()!=null&&field.getProperty().length()>0)
		{
			value=ValidatorUtils.getValueAsString(bean,field.getProperty());
		}
		try
		{
			if(value==null||value.length()==0)
			{
				return true;
			}
			return PortalValidate.isPhone(value);
		}
		finally
		{
			value=null;
		}
	}

	/**
	 * 校验手机号码格式是否有效，有效返回false否则返回true
	 * 
	 * @param bean
	 * @param field
	 * 
	 * @return
	 */
	public boolean validateMobile(Object bean,Field field)
	{
		String value=null;
		if(field.getProperty()!=null&&field.getProperty().length()>0)
		{
			value=ValidatorUtils.getValueAsString(bean,field.getProperty());
		}
		try
		{
			if(value==null||value.length()==0)
			{
				return true;
			}
			return PortalValidate.isMobile(value);
		}
		finally
		{
			value=null;
		}
	}

	/**
	 * 校验手机或电话号码格式有效，有效返回false否则返回true
	 * 
	 * @param bean
	 * @param field
	 * 
	 * @return
	 */
	public boolean validatePhoneOrMobile(Object bean,Field field)
	{
		String value=null;
		if(field.getProperty()!=null&&field.getProperty().length()>0)
		{
			value=ValidatorUtils.getValueAsString(bean,field.getProperty());
		}
		try
		{
			if(value==null||value.length()==0)
			{
				return true;
			}
			return (PortalValidate.isMobile(value)||PortalValidate.isPhone(value));
		}
		finally
		{
			value=null;
		}
	}

	/**
	 * 检验货币格式是否有效，，有效返回false否则返回true(小数点最大为4位)
	 * 
	 * @param bean
	 * @param field
	 * 
	 * @return
	 */
	public boolean validateCurrency(Object bean,Field field)
	{
		String value=null;
		if(field.getProperty()!=null&&field.getProperty().length()>0)
		{
			value=ValidatorUtils.getValueAsString(bean,field.getProperty());
		}
		try
		{
			if(value==null||value.length()==0)
			{
				return true;
			}
			return PortalValidate.isCurrency(value);
		}
		finally
		{
			value=null;
		}
	}

	/**
	 * 判断str是否是url格式，是返回false否则返回true
	 * 
	 * @param bean
	 * @param field
	 * 
	 * @return
	 */
	public boolean validateUrl(Object bean,Field field)
	{

		String value=null;

		if(field.getProperty()!=null&&field.getProperty().length()>0)
		{
			value=ValidatorUtils.getValueAsString(bean,field.getProperty());
		}
		try
		{
			if(value==null||value.length()==0)
			{
				return true;
			}
			return PortalValidate.isUrl(value);
		}
		finally
		{
			value=null;
		}
	}

	/**
	 * 判断str是否是数字，是返回false否则返回true
	 * 
	 * @param bean
	 * @param field
	 * 
	 * @return
	 */
	public boolean validateNumber(Object bean,Field field)
	{

		String value=null;

		if(field.getProperty()!=null&&field.getProperty().length()>0)
		{
			value=ValidatorUtils.getValueAsString(bean,field.getProperty());
		}
		try
		{
			if(value==null||value.length()==0)
			{
				return true;
			}
			return PortalValidate.isNumber(value);
		}
		finally
		{
			value=null;
		}
	}

	/**
	 * 判断str是否是邮政编码，是返回true否则返回false,(长度为6位的数字)
	 * 
	 * @param bean
	 * @param field
	 * 
	 * @return
	 */
	public boolean validateZip(Object bean,Field field)
	{

		String value=null;

		if(field.getProperty()!=null&&field.getProperty().length()>0)
		{
			value=ValidatorUtils.getValueAsString(bean,field.getProperty());
		}
		try
		{
			if(value==null||value.length()==0)
			{
				return true;
			}
			return PortalValidate.isZip(value);
		}
		finally
		{
			value=null;
		}
	}

	/**
	 * 判断str是否是整数(可带正负号),是返回false否则返回true
	 * 
	 * @param bean
	 * @param field
	 * 
	 * @return
	 */
	public boolean validateInteger(Object bean,Field field)
	{

		String value=null;
		if(field.getProperty()!=null&&field.getProperty().length()>0)
		{
			value=ValidatorUtils.getValueAsString(bean,field.getProperty());
		}
		try
		{
			if(value==null||value.length()==0)
			{
				return true;
			}
			return PortalValidate.isInteger(value);
		}
		finally
		{
			value=null;
		}
	}

	/**
	 * 判断str是否是单精度(可带正负号),是返回false否则返回true
	 * 
	 * @param bean
	 * @param field
	 * 
	 * @return
	 */
	public boolean validateFloat(Object bean,Field field)
	{

		String value=null;
		if(field.getProperty()!=null&&field.getProperty().length()>0)
		{
			value=ValidatorUtils.getValueAsString(bean,field.getProperty());
		}
		try
		{
			if(value==null||value.length()==0)
			{
				return true;
			}
			return PortalValidate.isFloat(value);
		}
		finally
		{
			value=null;
		}

	}

	/**
	 * 判断str是否只有字母,是返回false否则返回true
	 * 
	 * @param bean
	 * @param field
	 * 
	 * @return
	 */
	public boolean validateEnglish(Object bean,Field field)
	{

		String value=null;

		if(field.getProperty()!=null&&field.getProperty().length()>0)
		{
			value=ValidatorUtils.getValueAsString(bean,field.getProperty());
		}
		try
		{
			if(value==null||value.length()==0)
			{
				return true;
			}
			return PortalValidate.isEnglish(value);
		}
		finally
		{
			value=null;
		}
	}

	/**
	 * 判断str是否是中文,是返回false否则返回true
	 * 
	 * @param bean
	 * @param field
	 * 
	 * @return
	 */
	public boolean validateChinese(Object bean,Field field)
	{

		String value=null;

		if(field.getProperty()!=null&&field.getProperty().length()>0)
		{
			value=ValidatorUtils.getValueAsString(bean,field.getProperty());
		}
		try
		{
			if(value==null||value.length()==0)
			{
				return true;
			}
			return PortalValidate.isChinese(value);
		}
		finally
		{
			value=null;
		}
	}

	/**
	 * 判断str是否较为安全的密码串,是返回false否则返回true
	 * 
	 * @param bean
	 * @param field
	 * 
	 * @return
	 */
	public boolean validatePwdSafe(Object bean,Field field)
	{

		String value=null;

		if(field.getProperty()!=null&&field.getProperty().length()>0)
		{
			value=ValidatorUtils.getValueAsString(bean,field.getProperty());
		}
		if(value==null) return true;
		if(value.length()>=6)
		{
			return true;
		}
		try
		{
			return false;
		}
		finally
		{
			value=null;
		}

	}

	/**
	 * 判断str是否是日期时间格式,是返回true否则返回false
	 * 
	 * @param bean
	 * @param field
	 * 
	 * @return
	 */
	public boolean validateTime(Object bean,Field field)
	{

		String value=null;

		if(field.getProperty()!=null&&field.getProperty().length()>0)
		{
			value=ValidatorUtils.getValueAsString(bean,field.getProperty());
		}
		try
		{
			if(value==null||value.length()==0)
			{
				return true;
			}
			return PortalValidate.isTime(value);
		}
		finally
		{
			value=null;
		}

	}

	/**
	 * 
	 * 判断str是否是日期格式(不含时间) 例子： String str="2005/01/01";
	 * isDate(str,"ymd","/");//返回true
	 * 
	 * @param bean
	 * @param field
	 * @return
	 */
	public boolean validateDate(Object bean,Field field)
	{

		String value=null;
		String parten=SystemUtil.getFrameworkDefaultResourceValue("domain.dateFormat");
		if(field.getProperty()!=null&&field.getProperty().length()>0)
		{
			value=ValidatorUtils.getValueAsString(bean,field.getProperty());
			if(value==null||value.length()==0)
			{
				return true;
			}
			Date d=CalendarUtil.string2Date(value,parten);
			value=CalendarUtil.date2String(d,parten);
		}
		try
		{
			return PortalValidate.isDate(value,parten);
		}
		finally
		{
			value=null;
		}

	}

	/**
	 * 判断str是否是日期格式(含时间) 例子： String str="2005/01/01 20:11:23";
	 * isDate(str,"ymd","/");//返回true
	 * 
	 * @param bean
	 * @param field
	 * 
	 * @return
	 */
	public boolean validateDateTime(Object bean,Field field)
	{

		String value=null;
		String parten=SystemUtil.getFrameworkDefaultResourceValue("domain.datetimeFormat");
		if(field.getProperty()!=null&&field.getProperty().length()>0)
		{
			value=ValidatorUtils.getValueAsString(bean,field.getProperty());
			if(value==null||value.length()==0)
			{
				return true;
			}
			value=CalendarUtil.date2String(CalendarUtil.string2Date(value,parten),parten);
		}
		try
		{
			return PortalValidate.isDate(value,parten);
		}
		finally
		{
			value=null;
			parten=null;
		}
	}

	/**
	 * str的长度是否在start与end之间，是返回false否则返回true,str==null返回false
	 * 
	 * @param bean
	 * @param field
	 * @return
	 */
	public boolean validateLengthScope(Object bean,Field field)
	{
		String value=null;

		if(field.getProperty()!=null&&field.getProperty().length()>0)
		{
			value=ValidatorUtils.getValueAsString(bean,field.getProperty());
		}
		if(value==null||value.length()==0)
		{
			return true;
		}
		int min=0,max=0;
		max=Integer.parseInt(field.getVarValue("maxLength"));
		min=Integer.parseInt(field.getVarValue("minLength"));
		try
		{
			return PortalValidate.isLengthScope(value,min,max);
		}
		finally
		{
			value=null;
		}
	}

	/**
	 * maxLength校验 str的长度是否超过maxlen,是返回false否则返回true
	 * 
	 * @param bean
	 * @param field
	 * @return
	 */
	public boolean validateGreatthanMaxLength(Object bean,Field field)
	{
		String value=null;
		if(field.getProperty()!=null&&field.getProperty().length()>0)
		{
			value=ValidatorUtils.getValueAsString(bean,field.getProperty());
		}
		if(value==null || value.length()==0)
		{
			return true;
		}
		int max=0;
		max=Integer.parseInt(field.getVarValue("maxLength"));
		try
		{
			return !PortalValidate.isGreatthanMaxLength(value,max);
		}
		finally
		{
			value=null;
		}
	}

	/**
	 * minLength校验 str的长度是否低于minlen,是返回false否则返回true
	 * 
	 * @param bean
	 * @param field
	 * @return
	 */
	public boolean validateLessthanMinLength(Object bean,Field field)
	{

		String value=null;

		if(field.getProperty()!=null&&field.getProperty().length()>0)
		{
			value=ValidatorUtils.getValueAsString(bean,field.getProperty());
		}
		if(value==null||value.length()==0)
		{
			return true;
		}
		int min=0;
		min=Integer.parseInt(field.getVarValue("minLength"));
		try
		{
			return !PortalValidate.isLessthanMinLength(value,min);
		}
		finally
		{
			value=null;
		}

	}

	/**
	 * (float类型)判断i <min，是返回false否则返回true
	 * 
	 * @param bean
	 * @param field
	 * @return
	 */
	public boolean validateFloatGreatthanMin(Object bean,Field field)
	{
		String value=null;

		if(field.getProperty()!=null&&field.getProperty().length()>0)
		{
			value=ValidatorUtils.getValueAsString(bean,field.getProperty());
		}
		if(value==null||value.length()==0)
		{
			return true;
		}
		float min=0;
		min=Float.parseFloat(field.getVarValue("minFloat"));
		try
		{
			return !PortalValidate.isLessthanMin(Float.parseFloat(value),min);
		}
		finally
		{
			value=null;
		}

	}

	/**
	 * (float类型)判断i>max，是返回false否则返回true
	 * 
	 * @param bean
	 * @param field
	 * @return
	 */
	public boolean validateFloatGreatthanMax(Object bean,Field field)
	{

		String value=null;

		if(field.getProperty()!=null&&field.getProperty().length()>0)
		{
			value=ValidatorUtils.getValueAsString(bean,field.getProperty());
		}
		if(value==null||value.length()==0)
		{
			return true;
		}
		float max=0;
		max=Float.parseFloat(field.getVarValue("maxFloat"));
		try
		{
			return !PortalValidate.isGreatthanMax(Float.parseFloat(value),max);
		}
		finally
		{
			value=null;
		}

	}
	/**
	 * i的值是否在start与end之间，是返回false否则返回true
	 * 
	 * @param bean
	 * @param field
	 * @return
	 */
	public boolean validateFloatScope(Object bean,Field field)
	{

		String value=null;

		if(field.getProperty()!=null&&field.getProperty().length()>0)
		{
			value=ValidatorUtils.getValueAsString(bean,field.getProperty());
		}
		if(value==null||value.length()==0)
		{
			return true;
		}
		float max=0,min=0;
		max=Float.parseFloat(field.getVarValue("maxFloat"));
		min=Float.parseFloat(field.getVarValue("minFloat"));
		try
		{
			return PortalValidate.isFloatScope(Float.parseFloat(value),min,max);
		}
		finally
		{
			value=null;
		}

	}
	/**
	 * (int类型)判断i <min，是返回false否则返回true
	 * 
	 * @param bean
	 * 
	 * @param field
	 * 
	 * 
	 * 
	 * @return
	 */
	public boolean validateIntGreatthanMin(Object bean,Field field)
	{
		String value=null;

		if(field.getProperty()!=null&&field.getProperty().length()>0)
		{
			value=ValidatorUtils.getValueAsString(bean,field.getProperty());
		}
		if(value==null||value.length()==0)
		{
			return true;
		}

		float min=0;
		min=Float.parseFloat(field.getVarValue("minInt"));
		try
		{
			return PortalValidate.isLessthanMin(Integer.parseInt(value),min);
		}
		finally
		{
			value=null;
		}
	}

	/**
	 * (int类型)判断i>max，是返回false否则返回true
	 * 
	 * @param bean
	 * @param field
	 * @return
	 */
	public boolean validateIntGreatthanMax(Object bean,Field field)
	{

		String value=null;

		if(field.getProperty()!=null&&field.getProperty().length()>0)
		{
			value=ValidatorUtils.getValueAsString(bean,field.getProperty());
		}
		if(value==null||value.length()==0)
		{
			return true;
		}

		float max=0;
		max=Float.parseFloat(field.getVarValue("maxInt"));
		try
		{
			return PortalValidate.isGreatthanMax(Integer.parseInt(value),max);
		}
		finally
		{
			value=null;
		}

	}

	/**
	 * i的值是否在start与end之间，是返回false否则返回true
	 * 
	 * @param bean
	 * @param field
	 * @return
	 */
	public boolean validateIntScope(Object bean,Field field)
	{

		String value=null;

		if(field.getProperty()!=null&&field.getProperty().length()>0)
		{
			value=ValidatorUtils.getValueAsString(bean,field.getProperty());
		}
		if(value==null||value.length()==0)
		{
			return true;
		}
		int max=0,min=0;
		max=Integer.parseInt(field.getVarValue("maxInt"));
		min=Integer.parseInt(field.getVarValue("minInt"));
		try
		{
			return PortalValidate.isIntScope(Integer.parseInt(value),min,max);
		}
		finally
		{
			value=null;
		}

	}

	/**
	 * 判断当前检查的日期大于指定一个日期是返回false否则true
	 * 
	 * @param bean
	 * @param field
	 * @return
	 */
	public boolean validateGreatDate(Object bean,Field field)
	{
		String value=null;
		if(field.getProperty()!=null&&field.getProperty().length()>0)
		{
			value=ValidatorUtils.getValueAsString(bean,field.getProperty());
		}
		if(value==null||value.length()==0)
		{
			return true;
		}
		
//		String parten=ExtStr.getLocalResourceStr("domain.dateFormat");
		String desDateName=field.getVarValue("desDateName");
		String desDateValue=ValidatorUtils.getValueAsString(bean,desDateName.replace("$",""));
		if(desDateName==null||value==null||value.length()==0||desDateValue==null||desDateValue.length()==0)
		{
			return true;
		}
		Date s=null;
		Date d=null;
		try
		{
			
//			 符号     含义                    表示                示例
//			 ------   -------                 ------------        -------
//			 G        年代标志符              (Text)              AD
//			 y        年                      (Number)            1996
//			 M        月                      (Text & Number)     July & 07
//			 d        日                      (Number)            10
//			 h        时 在上午或下午 (1~12)  (Number)            12
//			 H        时 在一天中 (0~23)      (Number)            0
//			 m        分                      (Number)            30
//			 s        秒                      (Number)            55
//			 S        毫秒                    (Number)            978
//			 E        星期                    (Text)              Tuesday
//			 D        一年中的第几天          (Number)            189
//			 F        一月中第几个星期几      (Number)            2  (2nd Wed in July)
//			 w        一年中第几个星期        (Number)            27
//			 W        一月中第几个星期        (Number)            2
//			 a        上午 / 下午 标记符      (Text)              PM
//			 k        时 在一天中 (1~24)      (Number)            24
//			 K        时 在上午或下午 (0~11)  (Number)            0
//			 z        时区                    (Text)      Pacific Standard Time
//			 '        文本转义符              (Delimiter)
//			 ''       单引号                  (Literal)           '
			
			SimpleDateFormat sdf=new SimpleDateFormat("EEE MMM dd HH:mm:ss zzz yyyy",Locale.US);
			s=sdf.parse(value);
			d=sdf.parse(desDateValue);
			
//			s=new Date(value);
//			d=new Date(desDateValue);
			// 要比较日期的表单对象
		}
		catch(Exception e)
		{
			return true;
		}
		try
		{
			return PortalValidate.greatDate(s,d);
		}
		finally
		{
			value=null;
			s=null;
			d=null;
			desDateName=null;
			desDateValue=null;
		}
	}

	/**
	 * 判断当前检查的日期大于等于指定一个日期是返回false否则true
	 * 
	 * @param bean
	 * @param field
	 * @return
	 */
	public boolean validateGreatEqualDate(Object bean,Field field)
	{
		String value=null;
		if(field.getProperty()!=null&&field.getProperty().length()>0)
		{
			value=ValidatorUtils.getValueAsString(bean,field.getProperty());
		}
		if(value==null)
		{
			return true;		
		}
//		String parten=ExtStr.getLocalResourceStr("domain.dateFormat");
		String desDateName=field.getVarValue("desDateName");
		String desDateValue=ValidatorUtils.getValueAsString(bean,desDateName.replace("$",""));
		if(desDateName==null||value==null||desDateValue==null||desDateValue.length()==0)
		{
			return true;
		}
		Date s=null;
		Date d=null;
		try
		{
			SimpleDateFormat sdf=new SimpleDateFormat("EEE MMM dd HH:mm:ss zzz yyyy",Locale.US);
			s=sdf.parse(value);
			d=sdf.parse(desDateValue);
//			s=new Date(value);
//			d=new Date(desDateValue);
			// 要比较日期的表单对象
		}
		catch(Exception e)
		{
			return true;
		}
		try
		{
			return PortalValidate.greatEqualDate(s,d);
		}
		finally
		{
			value=null;
			s=null;
			d=null;
			desDateName=null;
			desDateValue=null;
		}
	}

	/**
	 * 判断当前检查的日期小于指定一个日期是返回false否则true
	 * 
	 * @param bean
	 * @param field
	 * @return
	 */
	public boolean validateLessDate(Object bean,Field field)
	{
		String value=null;
		if(field.getProperty()!=null&&field.getProperty().length()>0)
		{
			value=ValidatorUtils.getValueAsString(bean,field.getProperty());
		}
		if(value==null||value.length()==0)
		{
			return true;
		}
		
//		String parten=ExtStr.getLocalResourceStr("domain.dateFormat");
		String desDateName=field.getVarValue("desDateName");
		String desDateValue=ValidatorUtils.getValueAsString(bean,desDateName.replace("$",""));
		if(desDateName==null||value==null||desDateValue==null||desDateValue.length()==0)
		{
			return true;
		}
		Date s=null;
		Date d=null;
		try
		{

//			s=new Date(value);
//			d=new Date(desDateValue);
			// 要比较日期的表单对象
			
			SimpleDateFormat sdf=new SimpleDateFormat("EEE MMM dd HH:mm:ss zzz yyyy",Locale.US);
			s=sdf.parse(value);
			d=sdf.parse(desDateValue);
			
		}
		catch(Exception e)
		{
			return true;
		}
		try
		{
			return PortalValidate.lessDate(s,d);
		}
		finally
		{
			value=null;
			s=null;
			d=null;
			desDateName=null;
		}
	}

	/**
	 * 判断当前检查的日期小于等于指定一个日期是返回false否则true
	 * 
	 * @param bean
	 * @param field
	 * @return
	 */
	public boolean validateLessEqualDate(Object bean,Field field)
	{
		String value=null;
		if(field.getProperty()!=null&&field.getProperty().length()>0)
		{
			value=ValidatorUtils.getValueAsString(bean,field.getProperty());
		}
		if(value==null||value.length()==0)
		{
			return true;
		}
//		String parten=ExtStr.getLocalResourceStr("domain.dateFormat");
		String desDateName=field.getVarValue("desDateName");
		String desDateValue=ValidatorUtils.getValueAsString(bean,desDateName.replace("$",""));
		if(desDateName==null||value==null||value.length()==0||desDateValue==null||desDateValue.length()==0)
		{
			return true;
		}
		Date s=null;
		Date d=null;
		try
		{
			// 要比较日期的表单对象
			SimpleDateFormat sdf=new SimpleDateFormat("EEE MMM dd HH:mm:ss zzz yyyy",Locale.US);
			s=sdf.parse(value);
			d=sdf.parse(desDateValue);
			
//			s=new Date(value);
//			d=new Date(desDateValue);
			return PortalValidate.lessEqualDate(s,d);
		}
		catch(Exception e)
		{
			log.error("HtmlValidate13Impl.validateLessEqualDate("+bean+","+field+")出错",e);
			ExceptionMessageParam emp=new ExceptionMessageParam();
			emp.setKeyOrMessageText("验证日期格式出错！");
			emp.setMessage(true);
			throw new SysException(emp,e);
		}
		finally
		{
			value=null;
			s=null;
			d=null;
			desDateName=null;
		}
	}
}
